﻿using System;
using System.Windows.Controls;
using c2iGMailNotifier.Messaging;
using GalaSoft.MvvmLight.Messaging;

namespace c2iGMailNotifier.View
{
    /// <summary>
    /// Logique d'interaction pour ToolbarView.xaml
    /// </summary>
    public partial class ToolbarView : UserControl
    {
        public ToolbarView()
        {
            InitializeComponent();
        }

        private void btnGoToGmail_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            System.Diagnostics.Process.Start("http://mail.google.com/mail");
        }

        private void btnOptions_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            Messenger.Default.Send(new ShowViewMessage(this) {ViewKey="OptionsView"});
        }

        private void btnRefresh_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            Messenger.Default.Send(new ShowViewMessage(this) { ViewKey = "EmailsListView" });
            Messenger.Default.Send(new RefreshMessage(this));
        }
    }
}